<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/tags/struts-bean" prefix="bean"%>
<%@ taglib uri="/tags/struts-html" prefix="html"%>
<%@ taglib uri="/tags/struts-logic" prefix="logic"%>
<html:html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title></title>
	<META http-equiv=Pragma content=no-cache>
	<META http-equiv=Cache-Control content=no-cache>
	<META http-equiv=Expires content=0>
	<link rel="stylesheet"
		href="<%=request.getContextPath()%>/resource/css/style.css"
		type="text/css">
	<script language="javascript" type="text/javascript"
		src="<%=request.getContextPath()%>/resource/js/util.js"></script>	
	<script language="javascript" type="text/javascript"
		src="<%=request.getContextPath()%>/resource/js/AdyhUtil.js"></script>
	<script language="javascript" type="text/javascript"
		src="<%=request.getContextPath()%>/resource/js/Validator.js"></script>
	<script language="javascript" type="text/javascript"
		src="<%=request.getContextPath()%>/resource/calendar/DCDA_C03.js"></script>	
	<script language="javascript">
	var flag = false;
function ShowFormTitle(strTitle)
{
	document.write("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"height:26px; background-position: left bottom; background-image: url(../../resource/image/FormTitle_A_4.gif); background-repeat: repeat-x;\">");
	document.write("  <tr >");
	document.write("	<td style=\"width:5px; background-position: left bottom; background-image: url(../../resource/image/FormTitle_A_1.gif); background-repeat: no-repeat;\">&nbsp;&nbsp;&nbsp;</td>");
	document.write("	<td class=\"FormTitle\" style=\"width:100%; padding-left:5px; padding-top:3px; background-position: left bottom; background-image: url(../../resource/image/FormTitle_A_2.gif); background-repeat: no-repeat;\">");
	document.write("		<span id=\"spanFormTitle\" class=\"SpanTitle\">"+ strTitle +"</span>");
	document.write("	</td>");
	document.write("	<td style=\"width:5px; background-position: right bottom; background-image: url(../../resource/image/FormTitle_A_3.gif); background-repeat: no-repeat;\">&nbsp;&nbsp;&nbsp;</td>");
    document.write("  </tr>");
	document.write("</table>");
}
function getMessage() 
  {
	var errorMsg = document.forms[0].errorFlag.value;
	
	if ("" != errorMsg) {
		//**操作成功！*/
		if (errorMsg == 0) {
			alert("<bean:message key="common.alert1"/>");
		}
		//**操作失败！*/
		if (errorMsg == 1) {
			alert("<bean:message key="common.alert2"/>");
		}
		//**查询无结果！*/
		if (errorMsg == 2) {
			alert("<bean:message key="common.alert3"/>");
		}
		//**系统异常，请联系管理员！*/
		if (errorMsg == 3) {
			alert("<bean:message key="common.alert4"/>");
		}
		document.forms[0].errorFlag.value = "";
	}
  }
/**非空校验*/
function CheckEmpty()
  {
	var manufacturingOrderBy = document.getElementById("manufacturingOrderBy").value;
	var productCodeBy = document.getElementById("productCodeBy").value;		
	if(manufacturingOrderBy.length==0&&productCodeBy==0){
		alert("<bean:message key="common.alert9"/>");
		return false;
	}else{
		return true;
	}
  }
//查询bomDetail  
function queryList()
  {
  	if(CheckEmpty()){ 
  	var frameName="bomDetail"; 	
  	var url = "F020204.do?operationType=bomQuery&manu="+document.forms[0].manufacturingOrderBy.value+"&productCode="+document.forms[0].productCodeBy.value+"&familyCode="+document.forms[0].familyCode.value+"&fromTable="+document.forms[0].fromTable.value+"&productType="+document.forms[0].productType.value;  	
	document.getElementById(frameName).src=url;
	}
	flag = true;
  }
//复制选中的bomDetail到当前工作号下
function copyList()
  {
  	if(flag){
  		if(document.frames["bomDetail"].CheckEmpty())
  		{
  			if (confirm("<bean:message key="adyh.confirm.copy"/>")) {
				operation('copyList');
			} else {
				return;
			}  			
  		}else{//执行查询,但无返回结果
  			alert("<bean:message key="common.alert10"/>");
  		}
  	}else{//变更输入值后,未执行查询  		
  		alert("<bean:message key="adyh.error.sFirst"/>");
  	}
  }
//输入待查询值后将flag置为false
function SearchStatus()
  {
  	flag = false;
  }
</script>
</head>
<%
String code;
String operationType;
String productType;
code=request.getParameter("code")==null?"":request.getParameter("code").toString();
operationType=request.getParameter("operationType")==null?"":request.getParameter("operationType").toString();
productType = request.getParameter("type")==null?"":request.getParameter("type").toString();
%>
<body>
	<html:form method="post" action="/pages/F02/F020203.do">
		<html:hidden property="operationType" />
		<html:hidden property="code" value="<%=code%>" />		
		<html:hidden property="errorFlag" />
		<html:hidden property="productType" value="<%=productType%>" />
		<!--Begin：表单标题-->
		<div class="DivBlock">
			<script language="javascript" type="text/javascript">
			ShowFormTitle("<bean:message key="F020203.title"/>");
			</script>
		</div>
		<!--End：表单标题-->

		<!--Begin：表单主体区块-->
		<div class="DivBlock">
			<div class="DivWrap" style="display:block">
				<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
					<TR>
						<TD ALIGN="right" NOWRAP WIDTH="15%">
							<!--工作号--><bean:message key="adyh.ManufacturingOrder"/>&nbsp;
						</TD>
						<TD ALIGN="left" NOWRAP WIDTH="18%">
							<html:text property="manufacturingOrder"  readonly="true" styleClass="MyTextReadOnly" />							
						</TD>
						<TD ALIGN="right" NOWRAP WIDTH="15%">
							<!--制造代码--><bean:message key="F02.ProductCode"/>&nbsp;
						</TD>
						<TD ALIGN="left" NOWRAP WIDTH="18%">
							<html:text property="productCode"  readonly="true" styleClass="MyTextReadOnly" />							
						</TD>
						<TD ALIGN="right" NOWRAP WIDTH="15%">
							<!--家族代码--><bean:message key="F02.FamilyCode"/>&nbsp;
						</TD>
						<TD ALIGN="left" NOWRAP WIDTH="19%">
							<html:text property="familyCode" readonly="true" styleClass="MyTextReadOnly" />						
						</TD>
					</TR>										
					<TR>
						<TD ALIGN="right" NOWRAP>
							<!--产品类别--><bean:message key="adyh.productType"/>&nbsp;
						</TD>
						<TD ALIGN="left" NOWRAP>
							<html:text property="productName" readonly="true" styleClass="MyTextReadOnly" />						
						</TD>
						<TD ALIGN="right" NOWRAP>
							<!--模型类别--><bean:message key="F02.ModelType"/>&nbsp;
						</TD>
						<TD ALIGN="left" NOWRAP>
							<html:text property="modelName" readonly="true" styleClass="MyTextReadOnly" />						
						</TD>
						<TD ALIGN="right" NOWRAP>
							<!--技术描述-->
							<bean:message key="adyh.description" />&nbsp;							
						</TD>
						<TD ALIGN="left" NOWRAP>
							<html:text property="orderDescription" readonly="true" styleClass="MyTextReadOnly" />							
						</TD>											
					</TR>																													
				</TABLE>
			</div>			
		</div>
		<!--End：表单主体区块-->
		<!--Begin：表单主体区块-->
		<div class="DivBlock">
		<div class="DivWrap" style="display:block">
				<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
					<TR>
						<TD ALIGN="right" NOWRAP WIDTH="15%">
							<!--工作号--><bean:message key="adyh.ManufacturingOrder"/>&nbsp;
						</TD>
						<TD ALIGN="left" NOWRAP WIDTH="18%">
							<html:text property="manufacturingOrderBy" styleClass="MyText"
							onchange="javascript:SearchStatus()" />							
						</TD>
						<TD ALIGN="right" NOWRAP WIDTH="15%">
							<!--制造代码--><bean:message key="F02.ProductCode"/>&nbsp;
						</TD>
						<TD ALIGN="left" NOWRAP WIDTH="18%">
							<html:text property="productCodeBy" styleClass="MyText"
							onchange="javascript:SearchStatus()" />							
						</TD>
						<TD ALIGN="right" NOWRAP WIDTH="15%">	
							<!--读取位置--><bean:message key="F02.FromProduct"/>&nbsp;
						</TD>
						<TD ALIGN="left" NOWRAP WIDTH="19%">
							<html:select property="fromTable" styleClass="MySelect">
								<html:option value="t_not_standard"><bean:message key="F02.FromNotStandard"/></html:option>	
								<html:option value="t_standard"><bean:message key="F02.FromStandard"/></html:option>								
							</html:select>													
						</TD>						
					</TR>
				</TABLE>
			</div>
			<div class="DivTail" style="display:block">
				<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
					<TR>					
					<TD align="left">
							<input type="button" name="Submit1" class="MyButton" value="<bean:message key="common.copy"/>"
								onClick="javascript:copyList();">				
					</TD>
					<TD align="right">													
							<input type="button" name="Submit1" class="MyButton" value="<bean:message key="common.query"/>" 
								onClick="javascript:queryList();">																		
							<input type="button" name="Submit1" class="MyButton" value="<bean:message key="common.back"/>"
								onClick="javascript:operation('back');">
					</TD>
					</TR>																															
				</TABLE>
			</div>			
		</div>
		<!--End：表单主体区块-->										
	</html:form>	
	<iframe id="bomDetail" width="100%" height="100%"
							src="F020204.do?operationType=<%=operationType%>&&code=<%=code%>&&productType=<%=productType%>" frameborder="0"/>
</body>
</html:html>
<script language="javascript" type="text/javascript">
InitForm();
</script>